# Written by Bram Cohen
# see LICENSE.txt for license information

from BitTornado.BTcrypto import CRYPTO_OK

defaults = [
    ('pex_allowed', 0,
        'whether to allow peer exchange or not'),
    ('crypto_allowed', int(CRYPTO_OK),
        'whether to allow the client to accept encrypted connections'),
    ('crypto_only', 0,
        'whether to only create or allow encrypted connections'),
    ('crypto_stealth', 0,
        'whether to prevent all non-encrypted connection attempts; ' +
        'will result in an effectively firewalled state on older trackers'),
    ('breakup_seed_bitfield', 1,
        'sends an incomplete bitfield and then fills with have messages, '
        'in order to get around stupid ISP manipulation'),
    ('security', 1,
        "whether to enable extra security features intended to prevent abuse"),
    ('auto_kick', 1,
        "whether to allow the client to automatically kick/ban peers that send bad data"),
    None,
    ('rerequest_interval', 5 * 60,
        'time to wait between requesting more peers'),
    ('min_peers', 20, 
        'minimum number of peers to not do rerequesting'),
    ('max_initiate', 40,
        'number of peers at which to stop initiating new connections'),
    ('max_connections', 0,
        "the absolute maximum number of peers to connect with (0 = no limit)"),
    ('negotiation_time', 15,
        "amount of time peers have to complete negotiating the connection"),
    ('optimistic_disconnect_timeout', 600,
        "amount of time peers are considered as inactive and get dropped"),
    None,
    ('download_slice_size', 2 ** 14,
        "How many bytes to query for per request."),
    ('max_slice_length', 2 ** 16,
        "maximum length slice to send to peers, larger requests are ignored"),
    ('upload_unit_size', 1460,
        "when limiting upload rate, how many bytes to send at a time"),
    ('min_uploads', 4,
        "the number of uploads to fill out to with extra optimistic unchokes"),
    ('max_uploads', 7,
        "the maximum number of uploads to allow at once."),
    ('request_backlog', 10,
        "maximum number of requests to keep in a single pipe at once."),
    None,
    ('max_message_length', 2 ** 23,
        "maximum length prefix encoding you'll accept over the wire - larger values get the connection dropped."),
    ('keepalive_interval', 120.0,
        'number of seconds to pause between sending keepalives'),
    ('timeout', 300.0,
        'time to wait between closing sockets which nothing has been received on'),
    ('timeout_check_interval', 60.0,
        'time to wait between checking if any connections have timed out'),
    ('max_rate_period', 20.0,
        "maximum amount of time to guess the current rate estimate represents"),
    ('upload_rate_fudge', 5.0, 
        'time equivalent of writing to kernel-level TCP buffer, for rate adjustment'),
    ('tcp_ack_fudge', 0.03,
        'how much TCP ACK download overhead to add to upload rate calculations ' +
        '(0 = disabled)'),
    ('http_timeout', 60, 
        'number of seconds to wait before assuming that an http connection has timed out'),
    ('snub_time', 30.0,
        "seconds to wait for data to come in over a connection before assuming it's semi-permanently choked"),
    ('rarest_first_cutoff', 2,
        "number of downloads at which to switch from random to rarest first"),
    ('rarest_first_priority_cutoff', 5,
        'the number of peers which need to have a piece before other partials take priority over rarest first'),
    ('round_robin_period', 30,
        "the number of seconds between the client's switching upload targets"),
    ]
